const { adminsModel } = require('./models/adminsModel');

module.exports.getSelfAdmin = async function(data) {
    const result = await adminsModel.findById(data);
    return result;
}
module.exports.addAdmins = async function(data) {
    await adminsModel.create(data);
}
module.exports.getAdmins = async function() {
    const result = await adminsModel.find().limit(15);
    return result;
}
module.exports.updateAdmins = async function(data, data1) {
    console.log(data1);
    const result = await adminsModel.findByIdAndUpdate(data, data1);
    return result;
}